home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Player Photo CD 1
/
Player Photo CD - Volume 1.iso
/
setup
/
title.mst
< prev
next >
Wrap
Text File
|
1994-11-27
|
6KB
|
241 lines
'' Global variables
GLOBAL TitleShortName$
GLOBAL TitleLongName$
GLOBAL MVBFileName$
GLOBAL PromptForPath%
GLOBAL DefaultPath$
GLOBAL ProgManGroup$
GLOBAL ProgManItem$
GLOBAL IconName$
'' ****************************************************************
TitleShortName$ = "Legend1"
TitleLongName$ = "Player PhotoMania #1"
MVBFileName$ = "player1"
PromptForPath% = 0
DefaultPath$ = "c:\legend"
ProgManGroup$ = "Player"
ProgManItem$ = "Player PhotoMania 1"
IconName$ = "pstill1"
GLOBAL CUIDLL$
'' Include files
'$INCLUDE 'setupapi.inc'
'' Custom UI dll
CUIDLL$ = "mscuistf.dll"
'' Dialog ID's
CONST DESTPATH = 1000
CONST APPHELP = 2000
CONST TOOBIG = 3000
CONST BADPATH = 4000
CONST SUCCESS = 5000
'' Bitmap ID
CONST LOGO = 1
'' Functions and subroutines
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetTitleDir (szDefault$) AS STRING
DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
DECLARE SUB ModifyProgramManager
DECLARE SUB ShowSuccess
i% = SetSizeCheckMode(scmOff)
SetTitle "Player PhotoMania #1"
SetBitmap CUIDLL$, LOGO
'' Read in the INF file.
ReadInfFile GetSymbolValue("STF_CWDDIR") + "TITLE.INF"
'' Modify Program Manager
ModifyProgramManager
'' Success dialog
ShowSuccess
QUIT:
END
'*************************************************************************
'** Purpose:
'** Prompts the user for a path for the title files
'** Arguments:
'** szDefault$ - default path
'** Returns:
'** New valid path name, or "" if the user quit.
'*************************************************************************
FUNCTION GetTitleDir (szDefault$) STATIC AS STRING
SetSymbolValue "String", TitleShortName$
SetSymbolValue "EditTextIn", szDefault$
SetSymbolValue "EditFocus", "ALL"
GETPATH:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, "FHelpDlgProc")
IF sz$ = "CONTINUE" THEN
szTitleDir$ = GetSymbolValue("EditTextOut")
IF IsDirWritable(szTitleDir$) = 0 THEN
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
GOTO GETPATH
END IF
UIPop 1
CreateDir szTitleDir$, cmoNone
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATH
ELSE
szTitleDir$ = ""
END IF
GetTitleDir = szTitleDir$
END FUNCTION
'*************************************************************************
'** Purpose:
'** Copies the files in the INF file
'** Arguments:
'** szTitleDir$ - destination directory for the title files
'** Returns
'** 1 if files were copied, 0 otherwise
'*************************************************************************
FUNCTION CopyFiles(szTitleDir$) STATIC AS INTEGER
'' Add all system files to the copy list
AddSectionFilesToCopyList "System Files", GetSymbolValue("STF_SRCDIR") + "setup\", GetWindowsSysDir()
'' Add all of the title files to the copy list
AddSectionFilesToCopyList "Installed Title Files", GetSymbolValue("STF_SRCDIR"), szTitleDir$
'' Check size
szExtras$ = "Extra"
szCosts$ = "Costs"
szNeededs$ = "Neededs"
FOR i% = 1 TO 26 STEP 1
AddListItem szExtras$, "0"
NEXT i%
'' We assume that VIEWER.INI will take another 4K
ReplaceListItem szExtras$, ASC(MID$(GetWindowsDir(), 1, 1)) - ASC("A") + 1, STR$(4096)
'' Get amount of space required
StillNeed& = GetCopyListCost(szExtras$, szCosts$, szNeededs$)
'' Put up a message if there is not enough space
FOR i% = 1 TO 26 STEP 1
IF VAL(GetListItem(szNeededs$, i%)) > 0 THEN
SetSymbolValue "String1", LTRIM$(STR$(VAL(GetListItem(szCosts$, i%)) / 1024))
SetSymbolValue "String2", CHR$(i% - 1 + ASC("A"))
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO TOOBIG
END IF
UIPop 1
CopyFiles = 0
GOTO DONTCOPY
END IF
NEXT i%
'' Copy the files
CopyFilesInCopyList
CopyFiles = 1
DONTCOPY:
END FUNCTION
'*************************************************************************
'** Purpose:
'** Puts up a success dialog
'*************************************************************************
SUB ShowSuccess STATIC
SUCCESS:
SetSymbolValue "String1", TitleShortName$
sz$ = UIStartDlg(CUIDLL$, SUCCESS, "FInfoDlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO SUCCESS
END IF
UIPop 1
END SUB
'*************************************************************************
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION
'*************************************************************************
'** Purpose:
'** Creates program manager entries for the title
'*************************************************************************
SUB ModifyProgramManager STATIC
szGork$ = GetSymbolValue("STF_SRCDIR")
CreateProgmanGroup ProgmanGroup$, "", cmoNone
ShowProgmanGroup ProgmanGroup$, 1, cmoNone
CreateProgmanItem ProgmanGroup$, ProgmanItem$, MakePath(GetSymbolValue("STF_SRCDIR"), MVBFileName$ + ".exe"), MakePath(GetSymbolValue("STF_SRCDIR"), IconName$ + ".ICO")+",0,0,0,"+szGork$, cmoOverwrite
CreateProgmanItem ProgmanGroup$, "Readme", MakePath(GetSymbolValue("STF_SRCDIR"), "readme.txt"), MakePath(GetSymbolValue("STF_SRCDIR"), "lrme.ICO")+",0,0,0,"+szGork$,cmoOverwrite
END SUB